﻿<%@ Page Title="Mobilhjulskift.dk - Bestilling af dit hjulskift" ValidateRequest="false" Language="C#" MasterPageFile="~/WebsiteSub.master" AutoEventWireup="true" CodeBehind="Bestilling.aspx.cs" Inherits="TireService.Website.Bestilling" %>

<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxHiddenField" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxLoadingPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>

<%@ Register src="~/UserControls/ucAddCarData.ascx" tagname="ucAddCarData" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <meta name="description" content="Bestil dit hjulskift abonnement online via vores bestillingsformular." />
    <meta name="keywords" content="hjulskift bestil dæk mobil abonnement" />

    <script type="text/javascript" language="javascript" src="https://betaling.curanet.dk/customers/curanet/js/openpaymentwindow.js"></script>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">

    <script type="text/javascript">
        // <![CDATA[
        function ShowCancelSignup() {
            pcCancelSignup.Show();
        }

        // ]]> 
    </script>

    <%--<!-- Modal popup when waiting on server postback -->
    <script src="Scripts/ModalPopup.js" type="text/javascript"></script>--%>
    <dx:ASPxLoadingPanel ID="LoadingPanel" Text="Vent venligst..." ClientInstanceName="LoadingPanel" runat="server" Modal="True">
    </dx:ASPxLoadingPanel>

    <!-- Modal popup that fires when user choose cancel signup -->
    <dx:ASPxPopupControl ID="pcCancelSignup" runat="server" CloseAction="CloseButton"
        Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter"
        ClientInstanceName="pcCancelSignup" HeaderText="Annuller bestilling" EnableAnimation="False"
        EnableViewState="False" ClientIDMode="AutoID" EnableHotTrack="False">
        <LoadingPanelStyle ImageSpacing="5px">
        </LoadingPanelStyle>
        <ContentCollection>
            <dx:PopupControlContentControl ID="PopupControlContentControl1" runat="server">
                <dx:ASPxPanel ID="Panel1" runat="server" DefaultButton="btOK">
                    <PanelCollection>
                        <dx:PanelContent ID="PanelContent1" runat="server">
                            <asp:Panel ID="pNeedHelp" runat="server">
                                <table width="350px">
                                    <tr>
                                        <td colspan="2">
                                            <h1>
                                                Du er ved at annullere din bestilling</h1>
                                            <p class="normaltext">
                                                Havde du problemer med bestillingen, og kan vi hjælpe dig ved at besvare nogle spørgsmål?</p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td valign="top">
                                            <dx:ASPxRoundPanel ID="rpCallMe" runat="server" Width="175px" HeaderText="Ja, venligst ring mig op"
                                                ClientIDMode="AutoID" EnableDefaultAppearance="true" GroupBoxCaptionOffsetX="6px"
                                                GroupBoxCaptionOffsetY="-19px">
                                                <ContentPaddings PaddingBottom="10px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="10px" />
                                                <HeaderStyle>
                                                    <Paddings PaddingBottom="6px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="3px" />
                                                </HeaderStyle>
                                                <PanelCollection>
                                                    <dx:PanelContent ID="PanelContent2" runat="server" SupportsDisabledAttribute="True">
                                                        <p class="mediumtext">
                                                            Udfyld navn og telefon, så ringer vi dig op
                                                            <br />
                                                            <br />
                                                            <dx:ASPxTextBox ID="txtCallMeName" runat="server" Width="150px" NullText="Navn" ToolTip="Indtast dit navn">
                                                                <ValidationSettings ErrorDisplayMode="ImageWithTooltip" ValidationGroup="CallMe">
                                                                    <RequiredField IsRequired="True" ErrorText="Navn skal udfyldes"></RequiredField>
                                                                </ValidationSettings>
                                                            </dx:ASPxTextBox>
                                                            <br />
                                                            <dx:ASPxTextBox ID="txtCallMePhone" runat="server" Width="150px" NullText="Telefon"
                                                                ToolTip="Indtast dit telefonnummer">
                                                                <ValidationSettings ErrorDisplayMode="ImageWithTooltip" ValidationGroup="CallMe">
                                                                    <RequiredField IsRequired="True" ErrorText="Telefon skal udfyldes"></RequiredField>
                                                                </ValidationSettings>
                                                            </dx:ASPxTextBox>
                                                            <br />
                                                            <%--<dx:ASPxButton ID="btnCallMe" runat="server" ClientIDMode="AutoID" 
                                                                Text="Ring mig op" AutoPostBack="true"
                                                                ValidationGroup="CallMe" OnClick="btnCallMe_Click">
                                                            </dx:ASPxButton>--%>
                                                        </p>
                                                    </dx:PanelContent>
                                                </PanelCollection>
                                            </dx:ASPxRoundPanel>
                                        </td>
                                        <td valign="top">
                                            <dx:ASPxRoundPanel ID="rpCallYou" runat="server" Width="175px" HeaderText="Ja, hvordan kan jeg kontakte jer?"
                                                ClientIDMode="AutoID" EnableDefaultAppearance="true" GroupBoxCaptionOffsetX="6px"
                                                GroupBoxCaptionOffsetY="-19px">
                                                <ContentPaddings PaddingBottom="10px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="10px" />
                                                <HeaderStyle>
                                                    <Paddings PaddingBottom="6px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="3px" />
                                                </HeaderStyle>
                                                <PanelCollection>
                                                    <dx:PanelContent ID="PanelContent3" runat="server" SupportsDisabledAttribute="True">
                                                        <p class="mediumtext">
                                                            Ring til os på tlf. <b>81 613 613</b>. Vi sidder klar til at hjælpe dig!
                                                        </p>
                                                    </dx:PanelContent>
                                                </PanelCollection>
                                            </dx:ASPxRoundPanel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <%--<dx:ASPxButton ID="btnContinueSignup" runat="server" ClientIDMode="AutoID" 
                                                Text="Tilbage til bestilling" >
                                                <ClientSideEvents Click="function(s, e) { pcCancelSignup.Hide(); }" />
                                            </dx:ASPxButton>--%>
                                        </td>
                                        <td align="right">
                                            <%--<asp:LinkButton ID="lbtnCancelSignup" runat="server" 
                                                OnClick="lbtnCancelSignup_Click">Til startsiden</asp:LinkButton>        --%>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel ID="pEmailSend" runat="server" Visible="false">
                                <table width="350px">
                                    <tr>
                                        <td>
                                            <h3>
                                                Tak for din henvendelse, du vil blive kontaktet af en af vores supportere indenfor
                                                24 timer.</h3>
                                            <br />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <dx:ASPxHyperLink ID="hlToStartPage" runat="server" Text="Til startsiden" NavigateUrl="~/Index.aspx">
                                            </dx:ASPxHyperLink>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                        </dx:PanelContent>
                    </PanelCollection>
                </dx:ASPxPanel>
            </dx:PopupControlContentControl>
        </ContentCollection>
    </dx:ASPxPopupControl>
    
    <!-- JavaScript for handling panels and client action -->
    <script type="text/javascript" language="javascript">

        // Variable used for calculation if data for all cars has been received
        var CarNumber = 1;

        // Function for changing order wizard steps font color
        function ChangeStepFormatting(lblFromStep, lblToStep) {
            var lblFromStep = lblFromStep.GetMainElement();
            lblFromStep.style.fontWeight = 'Normal';

            var lblToStep = lblToStep.GetMainElement();
            lblToStep.style.fontWeight = 'Bold';
        }

        // Function that runs when subscription/product is selected in list -> show info on subscription in roundpanel
        function SubscriptionSelectionChanged(){
            // Get subscription
            // Validate values
            rblSubscription.Validate();

            var isFormValid = ASPxClientEdit.ValidateGroup("Step1");
            if (isFormValid) {
                // Load subscription information on serverside
                callBackSubscriptionSelected.PerformCallback(rblSubscription.GetValue());
            }
            else 
            {
                alert('Vælg et produkt');
            }
        }

        // Function that add a specific quantity of the selected subscription to the customer order
        function AddSubscriptionToOrder(){
            
            // Validate values
            rblSubscription.Validate();
            txtQuantity.Validate();

            var isFormValidStep1 = ASPxClientEdit.ValidateGroup("Step1");
            var isFormValid = ASPxClientEdit.ValidateGroup("AddSubscription");
            if (isFormValid & isFormValidStep1) {
                if (txtQuantity.GetValue < 0) {
                    alert('Antal skal være større end 0');
                } else {
                    // Get values for callback (0: SubscriptionId, 1: Quantity)
                    var values = rblSubscription.GetValue() + '|' + txtQuantity.GetValue();
                    
                    // Perform server callback to update order
                    callBackAddSubscription.PerformCallback(values);
                }
            }
        }

        // Function that change UI for step 2 in ordering form
        function GoToStep2() { 
            // Validate if orders has been selected
            if (gvSelectedProducts.pageRowCount < 1) 
            {
                alert('Tilføj produkt til ordre før bestilling kan fortsættes')
            }
            else {
                // Show/hide panels
                pStep1_SelectProduct.SetVisible(false);

                // Server callback to check if customer address was pre-filled in booking system
                callBackCustomerAddressPrefilled.PerformCallback();

                // Show loadingpanel while doing postback
                LoadingPanel.Show();
            }
        }

        // Function that runs when subscription has been selected and postback to server is completed
        function OnCallbackSubscriptionSelectedComplete(s, e) {
            // Get values from serverside (0: Description, 1: Price, 2: HTML description)
            var values = e.result.split("|");

            rpSubscriptionInformation.SetHeaderText(values[0]);
            lblSubscriptionPrice.SetText(values[1]);
            subscriptiondetails.innerHTML = values[2];

            // Show subscription information
            rpSubscriptionInformation.SetVisible(true);
        }

        // Function that runs when subscription has been added to shoppingcart and postback to server is completed
        function OnCallbackAddSubscriptionComplete(s, e) {
            // Refresh gridview with orders
            gvSelectedProducts.PerformCallback();
        }

        function CallBackError(s, e) {
            // Hide loadingpanel in case it is running
            LoadingPanel.Hide();

            //alert('Fejl opstod: ' + e.message);
        }

        // Step 2 Javascripts - Handling of customer information

        function OnCallbackCustomerAddressPrefilledComplete(s, e) {
            if (e.result != null && e.result != "") {
                // Get address values from serverside (0: Address, 1: ZipCode, 2: City)
                var values = e.result.split("|");

                txtAddress.SetText(values[0]);
                txtZipCode.SetText(values[1]);
                txtCity.SetText(values[2]);
                txtSecondaryAddress.SetText(values[0]);
                txtSecondaryZipCode.SetText(values[1]);
                txtSecondaryCity.SetText(values[2]);
                cbUsePrimaryAddress.SetChecked(true);
            }

            // Hide loadingpanel after postback
            LoadingPanel.Hide();

            pStep2_CustomerInfo.SetVisible(true);

            // Change wizard steps
            ChangeStepFormatting(hlStep1_SelectProduct, hlStep2_CustomerInfo);
        }

        function OnUsePrimaryAddressCheckedChanged(s) {
            txtSecondaryAddress.SetText(txtAddress.GetText());
            txtSecondaryZipCode.SetText(txtZipCode.GetText());
            txtSecondaryCity.SetText(txtCity.GetText());
        }

        function ReturnToStep1() {
            // Show/hide panels
            pStep1_SelectProduct.SetVisible(true);
            pStep2_CustomerInfo.SetVisible(false);

            // Change wizard steps
            ChangeStepFormatting(hlStep2_CustomerInfo, hlStep1_SelectProduct);
        }

        function GoToStep3() {
            // Validate values
            txtName.Validate();
            txtAddress.Validate();
            txtZipCode.Validate();
            txtCity.Validate();
            ddlCountry.Validate();
            txtSecondaryAddress.Validate();
            txtSecondaryZipCode.Validate();
            txtSecondaryCity.Validate();
            txtPhone1.Validate();
            ddlPhone1Type.Validate();
            txtEmail.Validate();
            ddlReference.Validate();

            var isFormValid = ASPxClientEdit.ValidateGroup("Step2");
            if (isFormValid) {
                // Show/hide panels
                pStep2_CustomerInfo.SetVisible(false);
                
                // Server callback to prepare step 3 based on orderlines
                callbackCarInfoPanel.PerformCallback();

                // Show loadingpanel while doing postback
                LoadingPanel.Show();
            }
        }

        // Step 3 Javascripts - Handling of car information

        function OnCarInfoPanelComplete(s, e) {
            // Show loadingpanel after postback
            LoadingPanel.Hide();
            
            // Show form for car information
            pStep3_CarInfo.SetVisible(true);

            // Check car count - if gridview should be shown
            var carcount = hfCarCount.Get('CarCount');
            gvCars.SetVisible(carcount != 1);

            // Change wizard steps
            ChangeStepFormatting(hlStep2_CustomerInfo, hlStep3_CarInfo);
        }

        // Function called from Add Car Data usercontrol when saving done
        function OrderingPageCallBack(carnumber) {
            // Check if only one car in order
            var carcount = hfCarCount.Get('CarCount');

            if (carcount == 1) {
                // Go to next step in ordering wizard
                // Show/hide panels

                pStep3_CarInfo.SetVisible(false);

                // Server callback to prepare/load confirmation step
                callbackStep4_CustomerConfirmPanel.PerformCallback();

                // Show loadingpanel while doing postback
                LoadingPanel.Show();
            }
            else {
                // TODO: Make code, so when editing one car in gridview - it does not automatic take the next one in a row
                // Check if return is from edit - else take next car


                var values = carnumber.split("|");

                if (values[1] == 'EditDone') {
                    gvCars.PerformCallback();

                    // Refresh edit car panel
                    callbackCarInfoPanel.PerformCallback();

                    // Show loadingpanel while doing postback
                    LoadingPanel.Show();
                } 
                else {
                    // Take next car

                    // Set car number
                    CarNumber = values[0];

                    gvCars.PerformCallback();

                    // Refresh edit car panel
                    callbackCarInfoPanel.PerformCallback(CarNumber);

                    // Show loadingpanel while doing postback
                    LoadingPanel.Show();
                }
            }
        }

        function EditCar(carnumber) {
            var input = 'Edit' + '|' + carnumber;

            // Refresh edit car panel
            callbackCarInfoPanel.PerformCallback(input);

            // Show loadingpanel while doing postback
            LoadingPanel.Show();
        }

        function ReturnToStep2() {
            // Show/hide panels
            pStep2_CustomerInfo.SetVisible(true);
            pStep3_CarInfo.SetVisible(false);

            // Change wizard steps
            ChangeStepFormatting(hlStep3_CarInfo, hlStep2_CustomerInfo);
        }

        function GoToStep4() {

            // Validate value
            rbPrimaryAddressTimeInterval.Validate();
            
            var isFormValid = ASPxClientEdit.ValidateGroup("Step3");
            if (isFormValid) {

                // Check if only one car in order
                var carcount = hfCarCount.Get('CarCount');
                if (carcount == 1) {
                    // Run function that are contained in AddCarData Usercontrol
                    AddCar();
                }
                else 
                {
                    if (gvCars.pageRowCount == CarNumber) {
                        // Show/hide panels

                        pStep3_CarInfo.SetVisible(false);

                        // Server callback to prepare/load confirmation step
                        callbackStep4_CustomerConfirmPanel.PerformCallback();

                        // Show loadingpanel while doing postback
                        LoadingPanel.Show();
                    }
                    else {
                        alert('Indtast data for alle biler')
                    }
                }

                
            }
        }

        // Step 4 Javascripts

        function OnStep4_CustomerConfirmPanelComplete(s, e) {
            // Hide loadingpanel after postback
            LoadingPanel.Hide();
            
            // Show confirmation form
            pStep4_CustomerConfirm.SetVisible(true);

            // Change wizard steps
            ChangeStepFormatting(hlStep3_CarInfo, hlStep4_CustomerConfirm);
        }

        function ReturnToStep3() {
            // Show/hide panels
            pStep3_CarInfo.SetVisible(true);
            pStep4_CustomerConfirm.SetVisible(false);

            // Change wizard steps
            ChangeStepFormatting(hlStep4_CustomerConfirm, hlStep3_CarInfo);
        }

        function GoToStep5() {

            // Validation
            rblPaymentMethod.Validate();

            var isFormValid = ASPxClientEdit.ValidateGroup("Step4");
            if (isFormValid) {

                var isForm2Valid = true;

                // Outcommented - will not be used before Payment API is implemented
//                if (rblPaymentMethod.GetValue().toString() == 1) {
//                    // Do validation related creditcard
//                    txtCardNumber.Validate();
//                    ddlExpireMonth.Validate();
//                    ddlExpireYear.Validate();
//                    txtCVC.Validate();

//                    isForm2Valid = ASPxClientEdit.ValidateGroup("Creditcard");
//                }

                if (isForm2Valid) {

                    // Disable button on client to avoid double click/postback
                    btnGoToStep5.SetEnabled(false);

                    // Disable go back button in case redirect to paymentgateway fails
                    btnReturnToStep3.SetEnabled(false);

                    // Check if confirmed order is voucher / quotation without subscriptions
                    var value = hfNoSubscriptionOrder.Get('NoSubscriptionOrder');

                    if (value == "False") {
                        // Order contains subscriptions

                        // Get values for server postback
                        // 0: Name
                        // 1: Address
                        // 2: ZipCode
                        // 3: City
                        // 4: Country
                        // 5: UsePrimaryAddress
                        // 6: SecondaryAddress
                        // 7: SecondaryZipCode
                        // 8: SecondaryCity
                        // 9: Phone1
                        // 10: Phone1Type
                        // 11: Phone2
                        // 12: Phone2Type
                        // 13: Email
                        // 14: Reference
                        // 15: PaymentMethod (1: Creditcard, 2: Banktransfer)                
                        // 16: On primary address in primetime
                        // 17: Reference (how has the customer heard about us?)
                        var input = txtName.GetText();
                        input += '|' + txtAddress.GetText();
                        input += '|' + txtZipCode.GetText();
                        input += '|' + txtCity.GetText();
                        input += '|' + ddlCountry.GetValue();
                        input += '|' + cbUsePrimaryAddress.GetChecked();
                        input += '|' + txtSecondaryAddress.GetText();
                        input += '|' + txtSecondaryZipCode.GetText();
                        input += '|' + txtSecondaryCity.GetText();
                        input += '|' + txtPhone1.GetText();
                        input += '|' + ddlPhone1Type.GetValue();
                        input += '|' + txtPhone2.GetText();
                        input += '|' + ddlPhone2Type.GetValue();
                        input += '|' + txtEmail.GetText();
                        input += '|' + ddlReference.GetValue();
                        input += '|' + rblPaymentMethod.GetValue();
                        input += '|' + rbPrimaryAddressTimeInterval.GetValue();
                        input += '|' + ddlReference.GetValue();

                        // Carry out creation of customer and payment of order
                        callBackFinaliseOrder.PerformCallback(input);
                    }
                    if (value == "True") {
                        // Order does NOT contain subscriptions

                        // Get values for server postback
                        var input = rblPaymentMethod.GetValue();

                        // Postback to server
                        callBackFinaliseOrderNoSubscription.PerformCallback(input);
                    }

                    // Show loadingpanel while doing postback
                    LoadingPanel.Show();
                }
            }
        }

        // NOT used currently, but might be used when PaymentGateway API is implemented
        function ShowPaymentMethod(radiobutton) {
            var value = radiobutton.GetValue();

            if (value == 1) {
                // Show panel for payment with credit card
                pCreditCardInfo.SetVisible(true);
            } 
            else {
                // Hide panel for payment with credit card
                pCreditCardInfo.SetVisible(false);
            }   
        }

        function OnCallbackFinaliseOrderComplete(s, e) {
            // Check if payment postback needs to be done
            var value = rblPaymentMethod.GetValue();
            if (value == 1) {
                window.location = e.result;
//                // Initiate payment posting
//                paymentsubmitform.innerHTML = e.result;

//                document.forms[0].action = "https://betaling.curanet.dk/paymentwindow.php";
//                document.forms[0].submit(); 

            }
            else {
                // Hide loadingpanel after postback
                LoadingPanel.Hide();
                
                // Show step5 - user choose banktransfer, show confirmation window/panel
                pStep5_Payment.SetVisible(true);
                pStep4_CustomerConfirm.SetVisible(false);

                // Change wizard steps
                ChangeStepFormatting(hlStep4_CustomerConfirm, hlStep5_Payment);
            }            
        }

        // Step 5 Javascripts
        function OnStep5_PaymentComplete(s, e) {
            
        }

        // Javascripts for voucher / quotation part
        
        // Function that loads a voucher/quotation, if valid and exist order is updated with quotationdetails
        function LoadVoucher() {
            // Validate values
            txtVoucher.Validate();

            var isFormValid = ASPxClientEdit.ValidateGroup("Voucher");
            if (isFormValid) {
                // Post voucher to server to validate and activate
                callBackLoadVoucher.PerformCallback(txtVoucher.GetText());

                // Show loadingpanel while doing postback
                LoadingPanel.Show();
            }
        }
        
        function OnCallbackLoadVoucherComplete(s, e) {
            // Hide loadingpanel after postback
            LoadingPanel.Hide();

            // Get values from serverside (Value indicate if order contains subscriptions - 0: No, 1: Yes)
            var value = e.result;

            // Disable voucher field
            txtVoucher.SetEnabled(false);
            btnVoucher.SetEnabled(false);

            // Message to user on voucher loaded
            alert('Rabatkode hentet - vælg næste eller tilføj yderligere produkter til din ordre');

            if (value == 0) {
                // Voucher / quotation DO NOT contain subscriptions

                // Hide subscription elements on form
                rblSubscription.SetVisible(false);
                btnGoToStep2.SetVisible(false);
                rpSubscriptionInformation.SetVisible(false);

                // Show new next button
                btnOrderQuotation.SetVisible(true);
            }

            if (value == 1) {
                // Voucher / quotation contains subscriptions

                // Refresh gridview with orders
                gvSelectedProducts.PerformCallback();
            }
        }

        function OrderQuotation() {
            // Hide panel
            pStep1_SelectProduct.SetVisible(false);
            
            // Server callback to prepare/load confirmation step
            var value = 1;

            callbackStep4_CustomerConfirmPanel.PerformCallback(value);

            // Show loadingpanel while doing postback
            LoadingPanel.Show();
        }

    </script>

    <dx:ASPxCallback ID="callBackSubscriptionSelected" ClientInstanceName="callBackSubscriptionSelected"
        runat="server" OnCallback="callBackSubscriptionSelected_Callback">
        <ClientSideEvents CallbackError="CallBackError" CallbackComplete="OnCallbackSubscriptionSelectedComplete" />
    </dx:ASPxCallback>
    
    <dx:ASPxCallback ID="callBackAddSubscription" ClientInstanceName="callBackAddSubscription"
        runat="server" OnCallback="callBackAddSubscription_Callback">
        <ClientSideEvents CallbackError="CallBackError" CallbackComplete="OnCallbackAddSubscriptionComplete" />
    </dx:ASPxCallback>

    <dx:ASPxCallback ID="callBackCustomerAddressPrefilled" ClientInstanceName="callBackCustomerAddressPrefilled"
        runat="server" OnCallback="callBackCustomerAddressPrefilled_Callback">
        <ClientSideEvents CallbackError="CallBackError" CallbackComplete="OnCallbackCustomerAddressPrefilledComplete" />
    </dx:ASPxCallback>

    <dx:ASPxCallback ID="callBackFinaliseOrder" ClientInstanceName="callBackFinaliseOrder"
        runat="server" OnCallback="callBackFinaliseOrder_Callback">
        <ClientSideEvents CallbackError="CallBackError" CallbackComplete="OnCallbackFinaliseOrderComplete" />
    </dx:ASPxCallback>

    <dx:ASPxCallback ID="callBackLoadVoucher" ClientInstanceName="callBackLoadVoucher"
        runat="server" OnCallback="callBackLoadVoucher_Callback">
        <ClientSideEvents CallbackError="CallBackError" CallbackComplete="OnCallbackLoadVoucherComplete" />
    </dx:ASPxCallback>

    <dx:ASPxCallback ID="callBackFinaliseOrderNoSubscription" ClientInstanceName="callBackFinaliseOrderNoSubscription"
        runat="server" OnCallback="callBackFinaliseOrderNoSubscription_Callback">
        <ClientSideEvents CallbackError="CallBackError" CallbackComplete="OnCallbackFinaliseOrderComplete" />
    </dx:ASPxCallback>

    <div id="paymentsubmitform">
    </div>

    <!-- Signup form -->                
    <div id="box1">
        <h1>Bestilling</h1>
        <hr />
        <dx:ASPxLabel ID="hlStep1_SelectProduct" Font-Bold="true" ClientInstanceName="hlStep1_SelectProduct" runat="server" Text="1. Vælg produkt">
        </dx:ASPxLabel>
        <dx:ASPxLabel ID="hlStep1_Arrow" ClientInstanceName="hlStep1_Arrow" runat="server" Text="->">
        </dx:ASPxLabel>
        <dx:ASPxLabel ID="hlStep2_CustomerInfo" ClientInstanceName="hlStep2_CustomerInfo" runat="server" Text="2. Kundeoplysninger">
        </dx:ASPxLabel>
        <dx:ASPxLabel ID="hlStep2_Arrow" ClientInstanceName="hlStep2_Arrow" runat="server" Text="->">
        </dx:ASPxLabel>
        <dx:ASPxLabel ID="hlStep3_CarInfo" ClientInstanceName="hlStep3_CarInfo" runat="server" Text="3. Bil oplysninger">
        </dx:ASPxLabel>
        <dx:ASPxLabel ID="hlStep3_Arrow" ClientInstanceName="hlStep3_Arrow" runat="server" Text="->">
        </dx:ASPxLabel>
        <dx:ASPxLabel ID="hlStep4_CustomerConfirm" ClientInstanceName="hlStep4_CustomerConfirm" runat="server" Text="4. Bekræftelse">
        </dx:ASPxLabel>
        <dx:ASPxLabel ID="hlStep4_Arrow" ClientInstanceName="hlStep4_Arrow" runat="server" Text="->">
        </dx:ASPxLabel>
        <dx:ASPxLabel ID="hlStep5_Payment" ClientInstanceName="hlStep5_Payment" runat="server" Text="5. Betaling">
        </dx:ASPxLabel>

        <%--<asp:Label ID="hlStep1_SelectProduct" runat="server" Text="1. Vælg produkt"></asp:Label>
        <asp:Label ID="Label1" runat="server" Text="->"></asp:Label>
        <asp:Label ID="hlStep2_CustomerInfo" runat="server" Text="2. Kundeoplysninger"></asp:Label>
        <asp:Label ID="Label2" runat="server" Text="->"></asp:Label>
        <asp:Label ID="hlStep3_CarInfo" runat="server" Text="3. Bil oplysninger"></asp:Label>
        <asp:Label ID="Label3" runat="server" Text="->"></asp:Label>
        <asp:Label ID="hlStep4_CustomerConfirm" runat="server" Text="4. Bekræftelse"></asp:Label>
        <asp:Label ID="Label4" runat="server" Text="->"></asp:Label>
        <asp:Label ID="hlStep5_Payment" runat="server" Text="5. Betaling"></asp:Label>--%>

        <hr />

        <dx:ASPxPanel ID="pStep1_SelectProduct" ClientInstanceName="pStep1_SelectProduct"
            runat="server" Width="100%">
            <PanelCollection>
                <dx:PanelContent ID="pcStep1_SelectProduct" runat="server">
                    <p class="mediumtext">
                        <b>
                            <dx:ASPxLabel ID="lblStep1Header" runat="server" Text="Vælg produkt" ClientIDMode="AutoID">
                            </dx:ASPxLabel>
                        </b>
                        <table cellspacing="5px" cellpadding="5px" border="0">
                            <tr>
                                <td valign="top">
                                    <dx:ASPxRadioButtonList ID="rblSubscription" ClientInstanceName="rblSubscription"
                                        runat="server" AutoPostBack="false" Font-Size="Larger">
                                        <ValidationSettings ValidationGroup="Step1" RequiredField-IsRequired="true" ErrorDisplayMode="ImageWithTooltip"
                                            RequiredField-ErrorText="Vælg et abonnement der passer til dig">
                                        </ValidationSettings>
                                        <ClientSideEvents SelectedIndexChanged="function(s, e) { SubscriptionSelectionChanged(); }" />
                                    </dx:ASPxRadioButtonList>
                                </td>
                                <td valign="top">
                                    <dx:ASPxRoundPanel ID="rpSubscriptionInformation" ClientInstanceName="rpSubscriptionInformation"
                                        runat="server" Width="300px" ClientVisible="false" ClientIDMode="AutoID" EnableDefaultAppearance="true"
                                        GroupBoxCaptionOffsetX="6px" GroupBoxCaptionOffsetY="-19px">
                                        <ContentPaddings PaddingBottom="10px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="10px" />
                                        <HeaderStyle>
                                            <Paddings PaddingBottom="6px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="3px" />
                                        </HeaderStyle>
                                        <PanelCollection>
                                            <dx:PanelContent ID="pcSubscriptionInformation" runat="server" SupportsDisabledAttribute="True">
                                                <div style="font-size: large">
                                                    <dx:ASPxLabel ID="lblSubscriptionPrice" ClientInstanceName="lblSubscriptionPrice"
                                                        runat="server" Text="Pris" ClientIDMode="AutoID">
                                                    </dx:ASPxLabel>
                                                </div>
                                                <div id="subscriptiondetails">
                                                </div>
                                                <br />
                                                <table>
                                                    <tr>
                                                        <td>
                                                            Antal
                                                        </td>
                                                        <td>
                                                            <dx:ASPxSpinEdit runat="server" Number="1" MinValue="1" MaxValue="10" ID="txtQuantity"
                                                                ClientInstanceName="txtQuantity" Width="50px" Height="21px">
                                                                <ValidationSettings ValidationGroup="AddSubscription" RequiredField-ErrorText="Antal skal angives"
                                                                    ErrorDisplayMode="ImageWithTooltip" RequiredField-IsRequired="true">
                                                                </ValidationSettings>
                                                            </dx:ASPxSpinEdit>
                                                        </td>
                                                        <td>
                                                            <dx:ASPxButton ID="btnAddSubscription" ClientInstanceName="btnAddSubscription" runat="server"
                                                                Text="Tilføj til ordre" AutoPostBack="False" UseSubmitBehavior="False">
                                                                <ClientSideEvents Click="function(s, e) { AddSubscriptionToOrder(); }" />
                                                            </dx:ASPxButton>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </dx:PanelContent>
                                        </PanelCollection>
                                    </dx:ASPxRoundPanel>
                                </td>
                                <td valign="top">
                                    <dx:ASPxGridView ID="gvSelectedProducts" runat="server" ClientInstanceName="gvSelectedProducts" Width="100%"
                                        KeyFieldName="SubscriptionId" AutoGenerateColumns="False" EnableCallBacks="True" oncustomunboundcolumndata="gvSelectedProducts_CustomUnboundColumnData"
                                        OnCustomCallback="gvSelectedProducts_CustomCallback" OnRowDeleting="gvSelectedProducts_RowDeleting">
                                        <SettingsLoadingPanel Text="Henter&amp;hellip;" />
                                        <SettingsText EmptyDataRow="Ingen produkter valgt" />
                                        <SettingsPager AlwaysShowPager="False" PageSize="10" Position="Bottom">
                                            <Summary AllPagesText="Sider: {0} - {1} ({2} produkter)" Text="Side {0} af {1} ({2} produkter)" />
                                        </SettingsPager>
                                        <SettingsText ConfirmDelete="Vil du slette denne linje i bestillingen?" />
                                        <SettingsBehavior AllowSort="false" ConfirmDelete="True" AllowGroup="false" AllowDragDrop="false" />
                                        <Columns>
                                             <dx:GridViewCommandColumn VisibleIndex="0">
                                                <DeleteButton Visible="True" Text="Slet">
                                                </DeleteButton>
                                            </dx:GridViewCommandColumn>
                                            <dx:GridViewDataColumn FieldName="SubscriptionId" Visible="false" VisibleIndex="0"
                                                Caption="SubscriptionId">
                                            </dx:GridViewDataColumn>
                                            <dx:GridViewDataTextColumn FieldName="Description" VisibleIndex="1" Caption="Produkt">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataColumn FieldName="Quantity" VisibleIndex="2" Caption="Antal">
                                            </dx:GridViewDataColumn>
                                            <dx:GridViewDataSpinEditColumn FieldName="OneTimeUnitPrice" VisibleIndex="3" Caption="Enheds pris">
                                                <PropertiesSpinEdit DisplayFormatString="c"></PropertiesSpinEdit>
                                            </dx:GridViewDataSpinEditColumn>

                                            <%--<dx:GridViewDataColumn FieldName="UnitPrice" VisibleIndex="3"  Caption="Enheds pris">
                                                <PropertiesEdit DisplayFormatString="c" />
                                            </dx:GridViewDataColumn>--%>

                                            <%--<dx:GridViewDataColumn FieldName="UnitPriceValue" VisibleIndex="3" Caption="Enheds pris" UnboundType="String">
                                            </dx:GridViewDataColumn>--%>
                                            
                                            <%--<dx:GridViewDataColumn FieldName="TotalPrice" VisibleIndex="4" Caption="Total pris">
                                                <PropertiesEdit DisplayFormatString="c" />
                                            </dx:GridViewDataColumn>--%>
                                            <dx:GridViewDataSpinEditColumn FieldName="TotalPrice" VisibleIndex="3" Caption="Total pris">
                                                <PropertiesSpinEdit DisplayFormatString="c"></PropertiesSpinEdit>
                                            </dx:GridViewDataSpinEditColumn>

                                            <%--<dx:GridViewDataColumn FieldName="TotalPriceValue" VisibleIndex="4" Caption="Total pris" UnboundType="String">
                                            </dx:GridViewDataColumn>--%>
                                        </Columns>
                                        <Settings ShowFooter="True" />
                                        <TotalSummary>
                                            <dx:ASPxSummaryItem FieldName="TotalPrice" SummaryType="Sum" />
                                        </TotalSummary>
                                    </dx:ASPxGridView>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3"> 
                                    <table>
                                        <tr>
                                            <td colspan="2">
                                                Har du en rabatkode? Aktiver den ved at indtaste nedenfor
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width:200px">
                                                <dx:ASPxTextBox ID="txtVoucher" ClientInstanceName="txtVoucher" MaxLength="25" runat="server"
                                                    Width="200px" ToolTip="Indtast rabat-/tilbudskode" NullText="Indtast rabat-/tilbudskode">
                                                    <ValidationSettings ValidationGroup="Voucher" RequiredField-ErrorText="Kode skal udfyldes"
                                                        ErrorDisplayMode="ImageWithTooltip" RequiredField-IsRequired="true">
                                                    </ValidationSettings>
                                                </dx:ASPxTextBox>
                                            </td>
                                            <td>
                                                <dx:ASPxButton ID="btnVoucher" ClientInstanceName="btnVoucher" runat="server" Text="Indløs"
                                                    AutoPostBack="False" UseSubmitBehavior="False">
                                                    <ClientSideEvents Click="function(s, e) { LoadVoucher(); }" />
                                                </dx:ASPxButton>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </p>
                    <hr />
                    <table width="100%">
                        <tr>
                            <td>
                            </td>
                            <td align="right">
                                <dx:ASPxButton ID="btnGoToStep2" ClientInstanceName="btnGoToStep2" runat="server"
                                    Text="Næste" AutoPostBack="False" UseSubmitBehavior="False">
                                    <ClientSideEvents Click="function(s, e) { GoToStep2(); }" />
                                </dx:ASPxButton>
                                <!-- Button used for voucher / quotation procurement -->
                                <dx:ASPxButton ID="btnOrderQuotation" ClientInstanceName="btnOrderQuotation" runat="server" ClientVisible="false"
                                    Text="Næste" AutoPostBack="False" UseSubmitBehavior="False">
                                    <ClientSideEvents Click="function(s, e) { OrderQuotation(); }" />
                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                    <hr />
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxPanel>

        <dx:ASPxPanel ID="pStep2_CustomerInfo" ClientInstanceName="pStep2_CustomerInfo" runat="server"
            Width="100%" ClientVisible="false">
            <PanelCollection>
                <dx:PanelContent ID="pcStep2_CustomerInfo" runat="server">
                    <p class="mediumtext">
                        
                        <b>
                            <dx:ASPxLabel ID="lblStep2Header" runat="server" Text="Kundeoplysninger" ClientIDMode="AutoID">
                            </dx:ASPxLabel>
                        </b>
                        <table border="0" cellspacing="0" cellpadding="5" width="425px">
                            <tr>
                                <td>
                                    <asp:Label ID="lblName" runat="server" Text="Navn: (*)"></asp:Label>
                                </td>
                                <td>
                                    <dx:ASPxTextBox ID="txtName" ClientInstanceName="txtName" MaxLength="50" runat="server"
                                        Width="175px" ClientIDMode="AutoID" ToolTip="Indtast dit navn her">
                                        <ValidationSettings ValidationGroup="Step2" RequiredField-IsRequired="true" RequiredField-ErrorText="Navn skal udfyldes"
                                            ErrorDisplayMode="ImageWithTooltip">
                                        </ValidationSettings>
                                    </dx:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblAddress" runat="server" Text="Adresse: (*)"></asp:Label>
                                </td>
                                <td>
                                    <dx:ASPxTextBox ID="txtAddress" ClientInstanceName="txtAddress" MaxLength="50" runat="server"
                                        Width="175px" ClientIDMode="AutoID" ToolTip="Indtast din adresse her">
                                        <ValidationSettings ValidationGroup="Step2" RequiredField-ErrorText="Adresse skal udfyldes"
                                            ErrorDisplayMode="ImageWithTooltip" RequiredField-IsRequired="true">
                                        </ValidationSettings>
                                    </dx:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblZipCode" runat="server" Text="Postnr: (*)"></asp:Label>
                                </td>
                                <td>
                                    <dx:ASPxTextBox ID="txtZipCode" ClientInstanceName="txtZipCode" MaxLength="4" runat="server"
                                        Width="50px" ClientIDMode="AutoID" ToolTip="Indtast dit postnr her">
                                        <ValidationSettings ValidationGroup="Step2" RequiredField-IsRequired="true" RequiredField-ErrorText="Postnr skal udfyldes"
                                            RegularExpression-ValidationExpression="\d{4}" RegularExpression-ErrorText="Postnr ikke gyldigt"
                                            ErrorDisplayMode="ImageWithTooltip" />
                                    </dx:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblCity" runat="server" Text="By: (*)"></asp:Label>
                                </td>
                                <td>
                                    <dx:ASPxTextBox ID="txtCity" ClientInstanceName="txtCity" MaxLength="50" runat="server"
                                        Width="175px" ClientIDMode="AutoID" ToolTip="Indtast din by her">
                                        <ValidationSettings ValidationGroup="Step2" RequiredField-ErrorText="By skal udfyldes"
                                            ErrorDisplayMode="ImageWithTooltip" RequiredField-IsRequired="true">
                                        </ValidationSettings>
                                    </dx:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblCountry" runat="server" Text="Land: (*)"></asp:Label>
                                </td>
                                <td>
                                    <dx:ASPxComboBox ID="ddlCountry" ClientInstanceName="ddlCountry" IncrementalFilteringMode="StartsWith"
                                        ToolTip="Vælg dit land" runat="server" ClientIDMode="AutoID" EnableIncrementalFiltering="True"
                                        Spacing="0" ValueType="System.String">
                                        <ValidationSettings ValidationGroup="Step2" RequiredField-IsRequired="true" RequiredField-ErrorText="Land skal vælges"
                                            ErrorDisplayMode="ImageWithTooltip">
                                        </ValidationSettings>
                                        <LoadingPanelStyle ImageSpacing="5px">
                                        </LoadingPanelStyle>
                                    </dx:ASPxComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    Sekundær adressen er det sted bilen holder mest, udover hjemmeadressen, ex. arbejdsplads,
                                    venner, osv. (Note: Må gerne være samme som primær adresse)
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <dx:ASPxCheckBox ID="cbUsePrimaryAddress" ClientInstanceName="cbUsePrimaryAddress"
                                        AutoPostBack="false" runat="server" Text="Sæt sekundær adresse til samme som ovenstående adresse">
                                        <ClientSideEvents CheckedChanged="function(s, e) { OnUsePrimaryAddressCheckedChanged(s); }" />
                                    </dx:ASPxCheckBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblSecondaryAddress" runat="server" Text="Sekundær adresse: (*)"></asp:Label>
                                </td>
                                <td>
                                    <dx:ASPxTextBox ID="txtSecondaryAddress" ClientInstanceName="txtSecondaryAddress"
                                        MaxLength="50" runat="server" Width="175px" ClientIDMode="AutoID" ToolTip="Indtast sekundær adresse hvor din bil holder">
                                        <ValidationSettings ValidationGroup="Step2" ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="Sekundær adresse skal udfyldes"
                                            RequiredField-IsRequired="true">
                                        </ValidationSettings>
                                    </dx:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblSecondaryZipCode" runat="server" Text="Sekundær postnr: (*)"></asp:Label>
                                </td>
                                <td>
                                    <dx:ASPxTextBox ID="txtSecondaryZipCode" ClientInstanceName="txtSecondaryZipCode"
                                        runat="server" MaxLength="4" Width="50px" ClientIDMode="AutoID" ToolTip="Indtast postnr for din sekundær adresse">
                                        <%--<MaskSettings Mask="0000" ErrorText="Post nr. ikke gyldigt" />--%>
                                        <ValidationSettings ValidationGroup="Step2" ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="Sekundær postnr skal udfyldes"
                                            RequiredField-IsRequired="true" RegularExpression-ValidationExpression="\d{4}"
                                            RegularExpression-ErrorText="Sekundær postnr ikke gyldigt">
                                        </ValidationSettings>
                                    </dx:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblSecondaryCity" runat="server" Text="Sekundær by: (*)"></asp:Label>
                                </td>
                                <td>
                                    <dx:ASPxTextBox ID="txtSecondaryCity" ClientInstanceName="txtSecondaryCity" MaxLength="50"
                                        runat="server" Width="175px" ClientIDMode="AutoID" ToolTip="Indtast by for din sekundær adresse">
                                        <ValidationSettings ValidationGroup="Step2" ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="Sekundær by skal udfyldes"
                                            RequiredField-IsRequired="true">
                                        </ValidationSettings>
                                    </dx:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblPhone1" runat="server" Text="Telefon: (*)"></asp:Label>
                                </td>
                                <td>
                                    <table border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td>
                                                <dx:ASPxTextBox ID="txtPhone1" ClientInstanceName="txtPhone1" runat="server" Width="75px"
                                                    ClientIDMode="AutoID" ToolTip="Indtast dit telefon nr">
                                                    <%--<MaskSettings Mask="00000000" ErrorText="Telefon nr. ikke gyldigt" />--%>
                                                    <ValidationSettings ValidationGroup="Step2" RequiredField-IsRequired="true" ErrorDisplayMode="ImageWithTooltip"
                                                        RegularExpression-ValidationExpression="\d{8}" RegularExpression-ErrorText="Telefon ikke gyldigt" />
                                                </dx:ASPxTextBox>
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td>
                                                <dx:ASPxComboBox ID="ddlPhone1Type" ClientInstanceName="ddlPhone1Type" runat="server"
                                                    Width="75px" ClientIDMode="AutoID" Spacing="0" ToolTip="Vælg telefon type for dit nr"
                                                    ValueType="System.String">
                                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="Venligst angiv type for telefon"
                                                        ValidationGroup="Step2" RequiredField-IsRequired="true">
                                                    </ValidationSettings>
                                                    <Items>
                                                        <dx:ListEditItem Value="0" Text="Mobil" Selected="true" />
                                                        <dx:ListEditItem Value="1" Text="Fastnet" />
                                                    </Items>
                                                    <LoadingPanelStyle ImageSpacing="5px">
                                                    </LoadingPanelStyle>
                                                </dx:ASPxComboBox>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblPhone2" runat="server" Text="Telefon2:"></asp:Label>
                                </td>
                                <td>
                                    <table border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td>
                                                <dx:ASPxTextBox ID="txtPhone2" ClientInstanceName="txtPhone2" runat="server" Width="75px"
                                                    ClientIDMode="AutoID" ToolTip="Indtast et sekundært telefonnr vi kan kontakte dig på">
                                                </dx:ASPxTextBox>
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td>
                                                <dx:ASPxComboBox ID="ddlPhone2Type" ClientInstanceName="ddlPhone2Type" runat="server"
                                                    Width="75px" ClientIDMode="AutoID" Spacing="0" ValueType="System.String" ToolTip="Vælg telefon type for dit sekundær nr">
                                                    <Items>
                                                        <dx:ListEditItem Value="0" Text="Mobil" />
                                                        <dx:ListEditItem Value="1" Text="Fastnet" Selected="true" />
                                                    </Items>
                                                    <LoadingPanelStyle ImageSpacing="5px">
                                                    </LoadingPanelStyle>
                                                </dx:ASPxComboBox>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblEmail" runat="server" Text="Email: (*)"></asp:Label>
                                </td>
                                <td>
                                    <dx:ASPxTextBox ID="txtEmail" ClientInstanceName="txtEmail" runat="server" Width="182px"
                                        ClientIDMode="AutoID" MaxLength="100">
                                        <ValidationSettings RegularExpression-ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                            ErrorDisplayMode="ImageWithTooltip" RegularExpression-ErrorText="Email ikke gyldig"
                                            RequiredField-IsRequired="true" RequiredField-ErrorText="Venligst udfyld email adresse"
                                            ValidationGroup="Step2">
                                        </ValidationSettings>
                                    </dx:ASPxTextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblReference" runat="server" Text="Hvor har du hørt om os: (*)"></asp:Label>
                                </td>
                                <td>
                                    <dx:ASPxComboBox ID="ddlReference" ClientInstanceName="ddlReference" runat="server" IncrementalFilteringMode="StartsWith" Width="200px"
                                        ClientIDMode="AutoID" Spacing="0" ValueType="System.String" ToolTip="Vælg hvor du har hørt om os" EnableIncrementalFiltering="True">
                                        <ValidationSettings ValidationGroup="Step2" RequiredField-ErrorText="Venligst angiv hvor du har hørt om os" RequiredField-IsRequired="true" ErrorDisplayMode="ImageWithTooltip">
                                        </ValidationSettings>
                                        <Items>
                                            <dx:ListEditItem Value="0" Text="Internet reklame" />
                                            <dx:ListEditItem Value="1" Text="Radiospot" />
                                            <dx:ListEditItem Value="2" Text="Anbefalet af ven/bekendt" />
                                            <dx:ListEditItem Value="3" Text="Søgning på nettet" />
                                            <dx:ListEditItem Value="4" Text="Via firma aftale" />
                                            <dx:ListEditItem Value="5" Text="Reklame på vores biler" />
                                            <dx:ListEditItem Value="6" Text="Andet" />
                                        </Items>
                                        <LoadingPanelStyle ImageSpacing="5px">
                                        </LoadingPanelStyle>
                                    </dx:ASPxComboBox>
                                </td>
                            </tr>
                        </table>
                    </p>
                    <hr />
                    <table width="100%">
                        <tr>
                            <td>
                                <dx:ASPxButton ID="btnReturnToStep1" ClientInstanceName="btnReturnToStep1" runat="server" TabIndex="10000"
                                    Text="Tilbage" AutoPostBack="False" UseSubmitBehavior="False">
                                    <ClientSideEvents Click="function(s, e) { ReturnToStep1(); }" />
                                </dx:ASPxButton>
                            </td>
                            <td align="right">
                                <dx:ASPxButton ID="btnGoToStep3" ClientInstanceName="btnGoToStep3" runat="server"
                                    Text="Næste" AutoPostBack="False" UseSubmitBehavior="False">
                                    <ClientSideEvents Click="function(s, e) { GoToStep3(); }" />
                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                    <hr />
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxPanel>

        <dx:ASPxPanel ID="pStep3_CarInfo" ClientInstanceName="pStep3_CarInfo" runat="server" Width="100%" ClientVisible="false">
             <PanelCollection> 
                <dx:PanelContent ID="pcStep3_CarInfo" runat="server"> 
                    <p class="mediumtext">
                        <b>
                            <dx:ASPxLabel ID="lblStep3Header" runat="server" Text="Bil oplysninger" ClientIDMode="AutoID" >
                            </dx:ASPxLabel> 
                        </b>
                        <br />Hvis du er i tvivl om data'ene for din bil (motorstørrelse, brændstof, ect) kan du via dit registreringsnr/nummerplade slå den op her: <a href="http://www.biltorvet.dk/minbil/minbil.aspx" target="_blank">Biltorvet.dk</a> 

                        <dx:ASPxCallbackPanel ID="callbackCarInfoPanel" ClientInstanceName="callbackCarInfoPanel" runat="server" OnCallback="callbackCarInfoPanel_Callback" RenderMode="Table">
                            <ClientSideEvents EndCallback="OnCarInfoPanelComplete" CallbackError="CallBackError" />
                            <PanelCollection>
                                <dx:PanelContent>
                                    <table>
                                        <tr>
                                            <td>
                                                <dx:ASPxLabel ID="lblPrimaryAddressTimeInterval" ClientInstanceName="lblPrimaryAddressTimeInterval" runat="server" Text="I tidsrummet 8-16 holder bilen/bilerne typisk på (*)">
                                                </dx:ASPxLabel>
                                            </td>
                                            <td colspan="2">
                                                <dx:ASPxRadioButtonList ID="rbPrimaryAddressTimeInterval" ClientInstanceName="rbPrimaryAddressTimeInterval" runat="server" Width="250px">
                                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" ValidationGroup="Step3" RequiredField-IsRequired="true" RequiredField-ErrorText="Venligst vælg hvilken adresse bilen/bilerne typisk holder på i tidsrummet kl. 8-16"></ValidationSettings>
                                                </dx:ASPxRadioButtonList>
                                            </td>
                                        </tr>
                                    </table>
                                    <dx:ASPxLabel ID="lblCarToAdd" runat="server" Text="" ClientIDMode="AutoID" >
                                    </dx:ASPxLabel> 
                                    <uc1:ucAddCarData ID="ucAddCarData1" ViewStateMode="Enabled" runat="server" />
                                    <!-- Hidden field used indicating number of cars in order -->
                                    <dx:ASPxHiddenField ID="hfCarCount" ClientInstanceName="hfCarCount" runat="server">
                                    </dx:ASPxHiddenField>
                                    <%--<hr />--%>
                                </dx:PanelContent>
                            </PanelCollection> 
                        </dx:ASPxCallbackPanel>
                        <dx:ASPxGridView ID="gvCars" runat="server" ClientInstanceName="gvCars"
                            KeyFieldName="CarNumber" AutoGenerateColumns="False" EnableCallBacks="True"
                            OnCustomCallback="gvCars_CustomCallback">
                            <SettingsLoadingPanel Text="Henter&amp;hellip;" />
                            <SettingsText EmptyDataRow="Ingen biler påført valgte produkter" />
                            <SettingsPager AlwaysShowPager="False" PageSize="20" Position="Bottom">
                                <Summary AllPagesText="Sider: {0} - {1} ({2} biler)" Text="Side {0} af {1} ({2} biler)" />
                            </SettingsPager>
                            <SettingsText ConfirmDelete="Vil du slette denne bil?" />
                            <SettingsBehavior AllowSort="false" ConfirmDelete="True" AllowGroup="false" AllowDragDrop="false" />
                            <Columns>
                                <dx:GridViewDataColumn Caption="Rediger" Width="106px" VisibleIndex="0">
                                    <DataItemTemplate>
                                        <a href="javascript:void(0);" onclick="EditCar('<%# Container.KeyValue %>')">Rediger</a>
                                    </DataItemTemplate>
                                </dx:GridViewDataColumn>
                                <dx:GridViewDataColumn FieldName="RegistrationNumber" VisibleIndex="0" Caption="Regnr">
                                </dx:GridViewDataColumn>
                                <dx:GridViewDataTextColumn FieldName="Model" VisibleIndex="1" Caption="Model">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataColumn FieldName="Year" VisibleIndex="2" Caption="Årgang">
                                </dx:GridViewDataColumn>
                                <dx:GridViewDataColumn FieldName="Color" VisibleIndex="3" Caption="Farve">
                                </dx:GridViewDataColumn>
                            </Columns>
                        </dx:ASPxGridView>                        
                    </p> 
                    <hr /> 
                    <table width="100%">
                        <tr>
                            <td>
                                <dx:ASPxButton ID="btnReturnToStep2" ClientInstanceName="btnReturnToStep2" runat="server" Text="Tilbage" AutoPostBack="False" UseSubmitBehavior="False" TabIndex="10000"> 
                                    <ClientSideEvents Click="function(s, e) { ReturnToStep2(); }" />
                                </dx:ASPxButton> 
                            </td>
                            <td align="right">
                                <dx:ASPxButton ID="btnGoToStep4" ClientInstanceName="btnGoToStep4" runat="server" Text="Næste" AutoPostBack="False" UseSubmitBehavior="False">
                                    <ClientSideEvents Click="function(s, e) { GoToStep4(); }" /> 
                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                    <hr />
                </dx:PanelContent>
             </PanelCollection>
        </dx:ASPxPanel>
                
        <dx:ASPxPanel ID="pStep4_CustomerConfirm" ClientInstanceName="pStep4_CustomerConfirm" runat="server" Width="100%" ClientVisible="false">
            <PanelCollection>
                <dx:PanelContent ID="pcStep4_CustomerConfirm" runat="server">
                    <dx:ASPxCallbackPanel ID="callbackStep4_CustomerConfirmPanel" ClientInstanceName="callbackStep4_CustomerConfirmPanel" runat="server" OnCallback="callbackStep4_CustomerConfirmPanel_Callback" RenderMode="Table">
                        <ClientSideEvents EndCallback="OnStep4_CustomerConfirmPanelComplete" CallbackError="CallBackError" />
                        <PanelCollection>
                            <dx:PanelContent>
                                <p class="mediumtext">
                                    <b>
                                        <dx:ASPxLabel ID="lblStep4Header" runat="server" Text="Bekræftelse af ordre" ClientIDMode="AutoID">
                                        </dx:ASPxLabel>
                                    </b>
                                    <br />
                                    <u>
                                        <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Valgte produkter" ClientIDMode="AutoID">
                                        </dx:ASPxLabel>
                                    </u>
                                    <br />
                                </p>
                                <dx:ASPxGridView ID="gvConfirmProducts" runat="server" ClientInstanceName="gvConfirmProducts"
                                    KeyFieldName="SubscriptionId" AutoGenerateColumns="False" EnableCallBacks="False">
                                    <SettingsLoadingPanel Text="Henter&amp;hellip;" />
                                    <SettingsText EmptyDataRow="Ingen produkter valgt" />
                                    <SettingsPager AlwaysShowPager="False" PageSize="10" Position="Bottom">
                                        <Summary AllPagesText="Sider: {0} - {1} ({2} produkter)" Text="Side {0} af {1} ({2} produkter)" />
                                    </SettingsPager>
                                    <SettingsBehavior AllowSort="false" ConfirmDelete="false" AllowGroup="false" AllowDragDrop="false" />
                                    <Columns>
                                        <dx:GridViewDataColumn FieldName="SubscriptionId" Visible="false" VisibleIndex="0"
                                            Caption="SubscriptionId">
                                        </dx:GridViewDataColumn>
                                        <dx:GridViewDataTextColumn FieldName="Description" VisibleIndex="1" Caption="Produkt">
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataColumn FieldName="Quantity" VisibleIndex="2" Caption="Antal">
                                        </dx:GridViewDataColumn>
                                        <%--<dx:GridViewDataColumn FieldName="UnitPrice" VisibleIndex="3" Caption="Enheds pris">
                                            <PropertiesEdit DisplayFormatString="c" />
                                        </dx:GridViewDataColumn>
                                        <dx:GridViewDataColumn FieldName="TotalPrice" VisibleIndex="4" Caption="Total pris">
                                            <PropertiesEdit DisplayFormatString="c" />
                                        </dx:GridViewDataColumn>--%>

                                        <dx:GridViewDataSpinEditColumn FieldName="OneTimeUnitPrice" VisibleIndex="3" Caption="Enheds pris">
                                            <PropertiesSpinEdit DisplayFormatString="c"></PropertiesSpinEdit>
                                        </dx:GridViewDataSpinEditColumn>

                                   
                                        <dx:GridViewDataSpinEditColumn FieldName="TotalPrice" VisibleIndex="3" Caption="Total pris">
                                            <PropertiesSpinEdit DisplayFormatString="c"></PropertiesSpinEdit>
                                        </dx:GridViewDataSpinEditColumn>



                                    </Columns>
                                    <Settings ShowFooter="True" />
                                    <TotalSummary>
                                        <dx:ASPxSummaryItem FieldName="TotalPrice" SummaryType="Sum" />
                                    </TotalSummary>
                                </dx:ASPxGridView>
                                <br />
                                <dx:ASPxPanel ID="pShowCostTirePickup" ClientInstanceName="pShowCostTirePickup" runat="server">
                                    <PanelCollection>
                                        <dx:PanelContent>
                                            <b>Pris for tilvalgt hjul afhentning</b>
                                            <dx:ASPxLabel ID="lblTirePickupPrice" runat="server" Text="" ClientIDMode="AutoID">
                                            </dx:ASPxLabel>
                                            <br />
                                            <b>Samlet ordre pris</b>
                                            <dx:ASPxLabel ID="lblTotalOrderPrice" runat="server" Text="" ClientIDMode="AutoID">
                                            </dx:ASPxLabel>
                                        </dx:PanelContent>
                                    </PanelCollection>
                                </dx:ASPxPanel>
                                <br />
                                <dx:ASPxPanel ID="pSubscriptionSignUpInformation" ClientInstanceName="pSubscriptionSignUpInformation" runat="server">
                                    <PanelCollection>
                                        <dx:PanelContent>
                                            <u>
                                                <dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="Kundeinformation" ClientIDMode="AutoID">
                                                </dx:ASPxLabel>
                                            </u>
                                            <br />
                                            <asp:Literal ID="lCustomerData" runat="server"></asp:Literal>
                                            <br />
                                            <u>
                                                <dx:ASPxLabel ID="ASPxLabel3" runat="server" Text="Bil informationer" ClientIDMode="AutoID">
                                                </dx:ASPxLabel>
                                            </u>
                                            <br />
                                            <dx:ASPxGridView ID="gvConfirmCars" runat="server" ClientInstanceName="gvConfirmCars"
                                                KeyFieldName="CarNumber" AutoGenerateColumns="False" EnableCallBacks="false">
                                                <SettingsLoadingPanel Text="Henter&amp;hellip;" />
                                                <SettingsText EmptyDataRow="Ingen biler påført valgte produkter" />
                                                <SettingsPager AlwaysShowPager="False" PageSize="20" Position="Bottom">
                                                    <Summary AllPagesText="Sider: {0} - {1} ({2} produkter)" Text="Side {0} af {1} ({2} produkter)" />
                                                </SettingsPager>
                                                <SettingsBehavior AllowSort="false" AllowGroup="false" AllowDragDrop="false" />
                                                <Columns>
                                                    <dx:GridViewDataColumn FieldName="RegistrationNumber" VisibleIndex="0" Caption="Regnr">
                                                    </dx:GridViewDataColumn>
                                                    <dx:GridViewDataTextColumn FieldName="Model" VisibleIndex="1" Caption="Model">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataColumn FieldName="Year" VisibleIndex="2" Caption="Årgang">
                                                    </dx:GridViewDataColumn>
                                                    <dx:GridViewDataColumn FieldName="Color" VisibleIndex="3" Caption="Farve">
                                                    </dx:GridViewDataColumn>
                                                </Columns>
                                            </dx:ASPxGridView>
                                        </dx:PanelContent>
                                    </PanelCollection>
                                </dx:ASPxPanel>
                                <br />
                                <b>Vælg betalingsmetode:</b>
                                <dx:ASPxRadioButtonList ID="rblPaymentMethod" ClientInstanceName="rblPaymentMethod" runat="server" Font-Size="Larger" AutoPostBack="false">
                                    <ValidationSettings ValidationGroup="Step4" RequiredField-IsRequired="true" ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="Vælg betalingsmetode">
                                    </ValidationSettings>
                                    <%--<ClientSideEvents SelectedIndexChanged="function(s, e) { ShowPaymentMethod(s) }" />--%>
                                    <Items>
                                        <dx:ListEditItem Value="1" Text="Online betaling med DK/Visa-DK" />
                                        <dx:ListEditItem Value="2" Text="Bankoverførsel" />
                                    </Items>
                                </dx:ASPxRadioButtonList>
                                <%--<dx:ASPxPanel ID="pCreditCardInfo" ClientInstanceName="pCreditCardInfo" runat="server" ClientVisible="false">
                                    <PanelCollection>
                                        <dx:PanelContent>
                                            <table>
                                                <tr>
                                                    <td colspan="2">
                                                        <dx:ASPxLabel ID="lblCarNumber" runat="server" Text="Kortnummer">
                                                        </dx:ASPxLabel>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <dx:ASPxTextBox ID="txtCardNumber" ClientInstanceName="txtCardNumber" runat="server" Width="120px">
                                                            <MaskSettings Mask="0000-0000-0000-0000" ErrorText="Kortnummer skal udfyldes med 16 tal" />
                                                            <ValidationSettings RequiredField-IsRequired="true" RequiredField-ErrorText="Kortnummer skal udfyldes"
                                                                ErrorDisplayMode="ImageWithTooltip" ValidationGroup="Creditcard">
                                                                <RequiredField ErrorText="Kortnummer skal udfyldes" IsRequired="True" />
                                                            </ValidationSettings>
                                                        </dx:ASPxTextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <dx:ASPxLabel ID="lblExpireDate" runat="server" Text="Udløbsdato (MM/YY)">
                                                        </dx:ASPxLabel>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <dx:ASPxComboBox ID="ddlExpireMonth" ClientInstanceName="ddlExpireMonth" runat="server" Width="50px" Spacing="0">
                                                            <Items>
                                                                <dx:ListEditItem Selected="true" Value="01" Text="01" />
                                                                <dx:ListEditItem Value="02" Text="02" />
                                                                <dx:ListEditItem Value="03" Text="03" />
                                                                <dx:ListEditItem Value="04" Text="04" />
                                                                <dx:ListEditItem Value="05" Text="05" />
                                                                <dx:ListEditItem Value="06" Text="06" />
                                                                <dx:ListEditItem Value="07" Text="07" />
                                                                <dx:ListEditItem Value="08" Text="08" />
                                                                <dx:ListEditItem Value="09" Text="09" />
                                                                <dx:ListEditItem Value="10" Text="10" />
                                                                <dx:ListEditItem Value="11" Text="11" />
                                                                <dx:ListEditItem Value="12" Text="12" />
                                                            </Items>
                                                            <ValidationSettings RequiredField-IsRequired="true" RequiredField-ErrorText="Udløbs måned skal udfyldes"
                                                                ValidationGroup="Creditcard">
                                                                <RequiredField ErrorText="Udløbs måned skal udfyldes" IsRequired="True" />
                                                            </ValidationSettings>
                                                            <LoadingPanelStyle ImageSpacing="5px">
                                                            </LoadingPanelStyle>
                                                        </dx:ASPxComboBox>
                                                    </td>
                                                    <td>
                                                        <dx:ASPxComboBox ID="ddlExpireYear" ClientInstanceName="ddlExpireYear" runat="server" Width="50px" Spacing="0">
                                                            <Items>
                                                                <dx:ListEditItem Value="13" Text="13" Selected="true" />
                                                                <dx:ListEditItem Value="14" Text="14" />
                                                                <dx:ListEditItem Value="15" Text="15" />
                                                                <dx:ListEditItem Value="16" Text="16" />
                                                                <dx:ListEditItem Value="17" Text="17" />
                                                                <dx:ListEditItem Value="18" Text="18" />
                                                                <dx:ListEditItem Value="19" Text="19" />
                                                                <dx:ListEditItem Value="20" Text="20" />
                                                                <dx:ListEditItem Value="21" Text="21" />
                                                                <dx:ListEditItem Value="22" Text="22" />
                                                                <dx:ListEditItem Value="23" Text="23" />
                                                            </Items>
                                                            <ValidationSettings RequiredField-IsRequired="true" RequiredField-ErrorText="Udløbs år skal udfyldes"
                                                                ValidationGroup="Creditcard">
                                                                <RequiredField ErrorText="Udløbs år skal udfyldes" IsRequired="True" />
                                                            </ValidationSettings>
                                                            <LoadingPanelStyle ImageSpacing="5px">
                                                            </LoadingPanelStyle>
                                                        </dx:ASPxComboBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <dx:ASPxLabel ID="lblSecurityNumber" runat="server" Text="CVC">
                                                        </dx:ASPxLabel>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <dx:ASPxTextBox ID="txtCVC" ClientInstanceName="txtCVC" runat="server" Width="30px">
                                                            <MaskSettings Mask="000" ErrorText="Sikkerhedskode skal angives med 3 tal" />
                                                            <ValidationSettings RequiredField-IsRequired="true" RequiredField-ErrorText="Sikkerhedskode skal udfyldes"
                                                                ErrorDisplayMode="ImageWithTooltip" ValidationGroup="Creditcard">
                                                                <RequiredField ErrorText="Sikkerhedskode skal udfyldes" IsRequired="True" />
                                                            </ValidationSettings>
                                                        </dx:ASPxTextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <dx:ASPxHyperLink ID="hlCreditCardGuide" runat="server" NavigateUrl="~/Betalingsvejledning.aspx"
                                                            Target="_blank" Text="Betalingsvejledning">
                                                        </dx:ASPxHyperLink>
                                                    </td>
                                                </tr>
                                            </table>
                                        </dx:PanelContent>
                                    </PanelCollection>
                                </dx:ASPxPanel>--%>
                                <br />
                                <u>
                                    <dx:ASPxLabel ID="ASPxLabel4" runat="server" Text="Salgs- og leveringsbetingelser"
                                        ClientIDMode="AutoID">
                                    </dx:ASPxLabel>
                                </u>
                                <br />
                                Læs vores betalings- og leveringsbetingelser her: <a href="~/HtmlTemplates/Betingelser.pdf"
                                    id="lnkPaymentTerms" runat="server" target="_blank">Link</a><br />
                                <br />
                                <dx:ASPxCheckBox ID="cbApproveTermns" ClientInstanceName="cbApproveTermns" AutoPostBack="false"
                                    Text="Jeg har læst og accepteret mobilhjulskift.dk's salgs- og leveringsbetingelser"
                                    runat="server">
                                    <ClientSideEvents CheckedChanged="function(s, e) { if (cbApproveTermns.GetChecked() == true) { btnGoToStep5.SetEnabled(true) } else { btnGoToStep5.SetEnabled(false) } }" />
                                </dx:ASPxCheckBox>

                                <!-- Hidden field used for determining if order contains subscriptions -->
                                <dx:ASPxHiddenField ID="hfNoSubscriptionOrder" ClientInstanceName="hfNoSubscriptionOrder" runat="server">
                                </dx:ASPxHiddenField>

                            </dx:PanelContent>
                        </PanelCollection> 
                    </dx:ASPxCallbackPanel>
                    <hr />
                    <table width="100%">
                        <tr>
                            <td>
                                <dx:ASPxButton ID="btnReturnToStep3" ClientInstanceName="btnReturnToStep3" runat="server" TabIndex="10000"
                                    Text="Tilbage" AutoPostBack="False" UseSubmitBehavior="False">
                                    <ClientSideEvents Click="function(s, e) { ReturnToStep3(); }" />
                                </dx:ASPxButton>
                            </td>
                            <td align="right">
                                <dx:ASPxButton ID="btnGoToStep5" ClientInstanceName="btnGoToStep5" runat="server" ClientEnabled="false"
                                    Text="Næste" AutoPostBack="False" UseSubmitBehavior="False">
                                    <ClientSideEvents Click="function(s, e) { GoToStep5(); }" />
                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                    <hr />
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxPanel>

        <dx:ASPxPanel ID="pStep5_Payment" ClientInstanceName="pStep5_Payment" runat="server" Width="100%" ClientVisible="false">
            <PanelCollection>
                <dx:PanelContent ID="PanelContent5" runat="server">
                    <dx:ASPxCallbackPanel ID="callbackStep5_PaymentPanel" ClientInstanceName="callbackStep5_PaymentPanel" runat="server" OnCallback="callbackStep5_Payment_Callback" RenderMode="Table">
                        <ClientSideEvents EndCallback="OnStep5_PaymentComplete" CallbackError="CallBackError" />
                        <PanelCollection>
                            <dx:PanelContent>
                                <b>Oprettelse gennemført</b><br />
                                Tak for din ordre - der er sendt en mail med ordre bekræftelse og faktura.<br /><br />
                                De venligste hilsner<br />
                                Mobilhjulskift.dk
                            </dx:PanelContent>
                        </PanelCollection>
                    </dx:ASPxCallbackPanel>
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxPanel>

        
        <asp:Panel ID="pErrorMessage" runat="server" Visible="false">
            <p class="mediumtext">
                <b>Fejl opstod</b><br />
                Modtagelsen af din bestilling fejlede desværre. Fejlen er logget og du vil blive kontaktet pr. telefon hurtigst muligt af en af vores supportere.<br /><br />
                Du er også velkommen til, at prøve at taste din bestilling igen ved at klikke her: <a href="Bestilling.aspx">Start forfra</a>.
            </p>
        </asp:Panel>
        
        <%--<table>
            <tr>
                <td>
                    <dx:ASPxButton ID="btnCancelSignup" runat="server" Text="Annuller bestilling" AutoPostBack="false" ClientIDMode="AutoID" >
                         <ClientSideEvents Click="function(s, e) { ShowCancelSignup(); }" /> 
                    </dx:ASPxButton>
                </td>
                <td>
                    
                </td>
                <td>
                    
                </td>
            </tr>
        </table>--%>
    </div>

</asp:Content>
